﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Itfort.Web
{
	/// <summary>
	/// 页面结果
	/// </summary>
	public class PageResult
	{
		/// <summary>
		/// 初始化类
		/// </summary>
		public PageResult()
		{
			this.Status = ResultStatus.Normal;
		}

		/// <summary>
		/// 结果状态
		/// </summary>
		public ResultStatus Status { get; set; }

		/// <summary>
		/// 失败信息
		/// </summary>
		public string FailureMessage { get; set; }

		/// <summary>
		/// 
		/// </summary>
		public void Success()
		{
			this.Status = ResultStatus.Success;
		}

		/// <summary>
		/// 
		/// </summary>
		/// <param name="message"></param>
		public void Failure(string message)
		{
			this.Status = ResultStatus.Failure;
			this.FailureMessage = message;
		}
	}

	/// <summary>
	/// 结果状态
	/// </summary>
	public enum ResultStatus
	{
		/// <summary>
		/// 正常
		/// </summary>
		Normal,
		/// <summary>
		/// 成功
		/// </summary>
		Success,
		/// <summary>
		/// 失败
		/// </summary>
		Failure
	}
}